package com.video.system.service.impl;

import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.system.mapper.VideoTeacherMapper;
import com.video.system.domain.VideoTeacher;
import com.video.system.service.IVideoTeacherService;

/**
 * 教师Service业务层处理
 * 
 * @author lyh
 * @date 2021-07-31
 */
@Service
public class VideoTeacherServiceImpl implements IVideoTeacherService 
{
    @Autowired
    private VideoTeacherMapper videoTeacherMapper;

    @Override
    public List<VideoTeacher> selectCodeAndNameList() {
        return videoTeacherMapper.selectCodeAndNameList();
    }

    /**
     * 查询教师
     * 
     * @param teacherId 教师ID
     * @return 教师
     */
    @Override
    public VideoTeacher selectVideoTeacherById(Integer teacherId)
    {
        return videoTeacherMapper.selectVideoTeacherById(teacherId);
    }

    /**
     * 查询教师列表
     * 
     * @param videoTeacher 教师
     * @return 教师
     */
    @Override
    public List<VideoTeacher> selectVideoTeacherList(VideoTeacher videoTeacher)
    {
        return videoTeacherMapper.selectVideoTeacherList(videoTeacher);
    }

    /**
     * 新增教师
     * 
     * @param videoTeacher 教师
     * @return 结果
     */
    @Override
    public int insertVideoTeacher(VideoTeacher videoTeacher)
    {
        videoTeacher.setCreateTime(DateUtils.getNowDate());
        return videoTeacherMapper.insertVideoTeacher(videoTeacher);
    }

    /**
     * 修改教师
     * 
     * @param videoTeacher 教师
     * @return 结果
     */
    @Override
    public int updateVideoTeacher(VideoTeacher videoTeacher)
    {
        videoTeacher.setUpdateTime(DateUtils.getNowDate());
        return videoTeacherMapper.updateVideoTeacher(videoTeacher);
    }

    /**
     * 批量删除教师
     * 
     * @param teacherIds 需要删除的教师ID
     * @return 结果
     */
    @Override
    public int deleteVideoTeacherByIds(Integer[] teacherIds)
    {
        return videoTeacherMapper.deleteVideoTeacherByIds(teacherIds);
    }

    /**
     * 删除教师信息
     * 
     * @param teacherId 教师ID
     * @return 结果
     */
    @Override
    public int deleteVideoTeacherById(Integer teacherId)
    {
        return videoTeacherMapper.deleteVideoTeacherById(teacherId);
    }
}
